using System;
using OS.Infrastructure.Domain;

namespace TaskKernel.Domain
{
    public class Rating : AbstractEntity
    {
        protected Rating()
        {
            DateCreate = DateTime.Now;
        }

        public Rating(Task task, Account owner, int ratingValue, string role) : this()
        {
            Task = task;
            Owner = owner;
            RatingValue = ratingValue;
            RoleOwner = role;
        }

        public virtual string RoleOwner { get; protected set; }
        public virtual Task Task { get; protected set; }
        public virtual Account Owner { get; protected set; }
        public virtual int RatingValue { get; protected set; }
        public virtual string RatingText { get; protected set; }
        public virtual DateTime DateCreate { get; protected set; }

        public virtual void SetComment(string comment)
        {
            RatingText = comment;
        }
    }
}